<template>
  <el-dialog
    :width="props.detailFormDialog.width"
    :title="props.detailFormDialog.title"
    :close-on-click-modal="false"
  >
    <div id="printJS-form">
      <slot name="detailFormDialogSlot"></slot>
    </div>
    <template #footer>
      <el-button
        style="float: left"
        type="primary"
        @click="
          print({
            printable: 'printJS-form',
            type: 'html',
            targetStyles: ['*'],
          })
        "
        >打印</el-button
      >
      <el-button @click="changeDetailFormDialogVisibleValue()">关闭</el-button>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { inject } from "vue";
import print from "print-js";

const props = inject("props");

const changeDetailFormDialogVisibleValue = inject(
  "changeDetailFormDialogVisibleValue"
);
</script>

<style scoped></style>
